import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: () => import('../components/Login') },
  {
    path: '/',
    component: () => import('../views/layout'),
    children: [
      // 默认展示首页子路由
      { path: '', component: () => import('@/views/home') },
      { path: '/my', component: () => import('../views/my') },
      { path: '/question', component: () => import('../views/qa') },
      { path: '/video', component: () => import('../views/video') }
    ]
  },
  { path: '/search', component: () => import('@/views/search') }
]

const router = new VueRouter({
  routes
})

export default router
